import requests

url = 'https://api.cheshi.com/services/common/api.php?api=login.Login'

headers = {
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36'
}

data={
    'act': 'login',
    'mobile': '13049865313',
    'source': 'pc',
    'password': 'A123456',
    'hold_time': 'yes'
}

session =requests.session()

# 登录
session.post(url,headers=headers,data=data)


admin_url = 'https://my.cheshi.com/user/'
# 这样就不用传递cookies
res = session.get(admin_url,headers=headers)

with open('./user.html',"w",encoding='utf-8') as f:
    f.write(res.text)
